package com.xuanwei.core.courier;

import com.xuanwei.core.entity.CourierInfo;
import com.xuanwei.core.enums.CourierCompany;

import java.io.IOException;

/**
 * @Author jiangyong
 * @Description TODO
 * @Date 2019/8/8 17:45
 **/
public abstract class QueryCourier {

    QueryCourier instance(String code) {
        CourierCompany[] values = CourierCompany.values();
        for (CourierCompany courierCompany : values) {
            if (courierCompany.getCode().equals(code)) {
                return courierCompany.getQueryCourier();
            }
        }
        return null;
    }

    /**
     * 查询物流信息
     *
     * @param billCode 运单号
     * @return 信息
     */
    public abstract CourierInfo query(String billCode) throws IOException;
}
